﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.Md23CustomPropertiesChoicesAddEdit.Delete_execute = function (screen) {
    screen.tlCustomPropertyChoices.deleteEntity();
    return myapp.commitChanges().then(null, function fail(e) {
        myapp.cancelChanges();
        throw e;
    });

};

myapp.Md23CustomPropertiesChoicesAddEdit.created = function (screen) {
    // Title
    if (screen.details.displayName != undefined)
        screen.details.displayName = screen.tlCustomPropertyChoices.Name;
    else
        screen.details.displayName = 'Neue Auswahl';

    // Delete Button
    if (screen.tlCustomPropertyChoices.IsBoundStatically) {
        var deleteButton = screen.findContentItem('deleteButton');
        deleteButton.isEnabled = (!screen.tlCustomPropertyChoices.IsBoundStatically);
    }
};